import React from 'react'
import { connect } from 'react-redux'
import Alert from '@material-ui/lab/Alert';
import './Alert.less'



function index(props) {
    return (
        <div>
            <Alert style={{ display: props.alertShow ? 'flex' : 'none' }} variant="filled" severity={props.alertType} className='alert'>
                {props.alertMsg}
            </Alert>
        </div>
    )
}
const mapStateToProps = (state) => {
    return {
        alertMsg:state.alertMsg,
        alertType:state.alertType,
        alertShow:state.alertShow
    }
}
export default connect(mapStateToProps, null)(index)